package ModelLayer;


/**
 * a person is the superclass to Costumer and Emplyee, it holds informatin about name, adress, a running id, postal code, phoneNumber and discount.
 * 
 * @author Team Black 
 * @version 1.0
 */
public class Person
{
    static int runningPersonId;
    private int id;
    private String name;
    private String adress;
    private String zipCode;
    private String phoneNr;
    private long discount;
   
    public Person()
    {
    
    }
    
    public Person(String _name, String _adress, String _zipCode, String _phoneNr)
    {
        runningPersonId++;
        id = runningPersonId;   
        name = _name;
        adress = _adress;
        zipCode = _zipCode;
        phoneNr = _phoneNr;
        discount = 0;
    }
    /**
     * mutator and accessor for the fields: ID, name, address, zipcode, phonenumber and Discount
     */
    public void setId(int _id)
    {
        id = _id;
    }
    public int getId()
    {
        return id;
    }
    public void setName(String _name)
    {
        name = _name;
    }
    public String getName()
    {
        return name;
    }
    public void setAdress(String _adress)
    {
        adress = _adress;
    }
    public String getAdress()
    {
        return adress;
    }
    public void setZipCode(String _zipCode)
    {
        zipCode = _zipCode;
    }
    public String getZipCode()
    {
        return zipCode;
    }
    public void setPhoneNr(String _phoneNr)
    {
        phoneNr = _phoneNr;
    }
    public String getPhoneNr()
    {
        return phoneNr;
    }
    public void setDiscount(long _discount)
    {
        discount = _discount;
    }
    public long getDiscount()
    {
        return discount;
    }
    
    public int getRunningPersinId()
    {
        return runningPersonId;
    }

}
